import request from '@/config/axios'

// 用户组 VO
export interface GroupsVO {
  id: number // 编号
  name: string // 名字
  description: string // 描述
  status: number // 状态
}

// 用户组 API
export const GroupsApi = {
  // 查询用户组分页
  getGroupsPage: async (params: any) => {
    return await request.get({ url: `/system/groups/page`, params })
  },

  // 查询用户组详情
  getGroups: async (id: number) => {
    return await request.get({ url: `/system/groups/get?id=` + id })
  },

  // 新增用户组
  createGroups: async (data: GroupsVO) => {
    return await request.post({ url: `/system/groups/create`, data })
  },

  // 修改用户组
  updateGroups: async (data: GroupsVO) => {
    return await request.put({ url: `/system/groups/update`, data })
  },

  // 删除用户组
  deleteGroups: async (id: number) => {
    return await request.delete({ url: `/system/groups/delete?id=` + id })
  },

  // 导出用户组 Excel
  exportGroups: async (params) => {
    return await request.download({ url: `/system/groups/export-excel`, params })
  },
}